<script setup>
import Son1Com from './components/Son1Com.vue';
import Son2Com from './components/Son2Com.vue';
import { useCounterStore } from '@/store/counter';
import { useChannelStore } from '@/store/channel'
import { storeToRefs } from 'pinia';
const CounterStore = useCounterStore()
const ChannelStore = useChannelStore()
const { count } = storeToRefs(CounterStore)


</script>

<template>
  <div>
    <h3>根组件
       -- {{ CounterStore.msg }}
       -- {{ count }}

    </h3>
  </div>
  <Son1Com></Son1Com>
  <Son2Com></Son2Com>
  <hr>
  <button @click="ChannelStore.getList">获取channel</button>
  <ul>
    <li v-for="item in ChannelStore.channelList" :key="item.id">{{ item.name }}</li>
  </ul>
</template>

<style scoped>

</style>
